import ajax from '@/utils/ajax';

// 获取订单列表
export function doOrderList(data) {
  return ajax({
    url: '/protal/order/getOrderList',
    method: 'post',
    data
  });
}
// 生成订单
export function doGenerateOrder(data) {
  return ajax({
    url: '/protal/order/generateOrder',
    method: 'post',
    data
  });
}

// 取消订单
export function doUpdateStatus(data) {
  return ajax({
    url: '/protal/order/updateStatus',
    method: 'post',
    data
  });
}

// 取消订单
export function doCancelOrder(data) {
  return ajax({
    url: '/protal/order/cancelOrder',
    method: 'post',
    data
  });
}

export function doOrderProduceList(data) {
  return ajax({
    url: '/protal/order/getOrderItemList',
    method: 'post',
    data
  });
}

export function doCreateQRImage(productId){
  return ajax({
    url: '/protal/wx/pay/createQRImage/' + productId,
    responseType: 'arraybuffer',
    method: 'get'
  });
}

export function doOrderPaySuccess(data) {
  return ajax({
    url: '/protal/order/paySuccess',
    method: 'post',
    data
  });
}
